package com.dx.factory;

import com.dx.api.RemoteEmailService;
import com.dx.domain.EmailDto;
import com.dx.result.R;
import org.springframework.cloud.openfeign.FallbackFactory;

public class RemoteEmailServiceFallbackFactory implements FallbackFactory<RemoteEmailService> {
    @Override
    public RemoteEmailService create(Throwable cause) {
        return new RemoteEmailService() {
            @Override
            public R<?> sendEmail(EmailDto emailDto, String token) {
                return R.fail("调用邮件服务发送邮件失败");
            }
        };
    }
}
